<?php

namespace apiend\modules\system\controllers;

use Yii;
use apiend\components\Controller;
use common\logics\RegionModel;

/**
 * 后台菜单管理
 * 
 * @author emhome <emhome@163.com>
 * @since 1.0
 */
class RegionController extends Controller {

    /**
     * 菜单列表
     * @inheritdoc
     */
    public function actionIndex($pid = 0) {
        return RegionModel::loadData($pid);
    }

    /**
     * @inheritdoc
     */
    public function getDists() {
        return [];
        $cache = Yii::$app->cache;
        $data = $cache->get('regionTree');
        if ($data !== false) {
            return $data;
        } else {
            $data = RegionModel::loadData();
            $cache->set('regionTree', $data);
            return $data;
        }
    }

}
